package _interview75;

import java.util.HashSet;
import java.util.List;

/**
 * 2215. 找出两数组的不同
 */
public class No2215 {
    public List<List<Integer>> findDifference(int[] nums1, int[] nums2) {
        HashSet<Integer> set1 = new HashSet<>();
        HashSet<Integer> set2 = new HashSet<>();

        for (int i : nums1) set1.add(i);
        for (int i : nums2) set2.add(i);

        for (int i : nums2) set1.remove(i);
        for (int i : nums1) set2.remove(i);

        return List.of(List.copyOf(set1), List.copyOf(set2));
    }
}
